import pymysql

db = pymysql.connect(host='localhost', user='root', password='926979', port=3306, database='test')

cursor = db.cursor()

cursor.execute("DROP TABLE IF EXISTS employee")

sql = """
CREATE TABLE `employee` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `first_name` VARCHAR(20) NOT NULL,
    `last_name` VARCHAR(20) DEFAULT NULL,
    `age` INT(1) DEFAULT NULL,
    `sex` CHAR(1) DEFAULT NULL,
    `income` FLOAT DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
"""

cursor.execute(sql)

print("Created table Successfull.")
db.close()
